package GUI;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class ProdSelecter extends JFrame {

	private JPanel contentPane;
	private Clothing clo;
	private Equipment eq;
	private Guns gun;
	
	/**
	 * Create the frame.
	 */
	public ProdSelecter() {
		setTitle("Products");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 350, 115);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JButton btnClothing = new JButton("Clothing");
		btnClothing.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				clo = new Clothing();
				clo.setVisible(true);
				dispose();
			}
		});
		btnClothing.setBounds(10, 11, 89, 23);
		contentPane.add(btnClothing);
		
		JButton btnEquipment = new JButton("Equipment");
		btnEquipment.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				eq = new Equipment();
				eq.setVisible(true);
				dispose();
			}
		});
		btnEquipment.setBounds(122, 11, 89, 23);
		contentPane.add(btnEquipment);
		
		JButton btnGunReplica = new JButton("Gun replica");
		btnGunReplica.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				gun = new Guns();
				gun.setVisible(true);
				dispose();
			}
		});
		btnGunReplica.setBounds(235, 11, 89, 23);
		contentPane.add(btnGunReplica);
		
		JButton btnBackToMain = new JButton("Back to main menu");
		btnBackToMain.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				MainMenu.getInstance().setVisible(true);
				dispose();
			}
		});
		btnBackToMain.setBounds(98, 45, 138, 23);
		contentPane.add(btnBackToMain);
	}
}
